#pragma once

#include "TurnGenerator.h"
#include "Match.h"
#include "Serializable.h"
#include "Team.h"

#include <iostream>

class ServiceProvider;

class Calendar : public Serializable
{
public:
	
	explicit Calendar(ServiceProvider* i_sp);

	void Clear();
	void Initialize(TeamVec& i_teamList);

	const MatchVec	GetCurrentTurn() const;
	const MatchVec	GetNextTurn() const;
	const size_t			GetTurnNumber() const;

	virtual	ZStream& Serialize(ZStream& o_stream);
	virtual ZStream& Deserialize(ZStream& i_stream);

	const TeamVec& GetTeamList() const;
	const TurnGenerator& GetTurnGenerator() const;

private:
	Calendar(const Calendar&);
	Calendar& operator=(const Calendar&);

	TurnGenerator m_turnGen;
	mutable size_t m_currentTurn;
	TeamVec* m_teamList;
	ServiceProvider* m_sp;
};

inline const TeamVec& Calendar::GetTeamList() const
{
	return *m_teamList;
}

inline const TurnGenerator& Calendar::GetTurnGenerator() const
{
	return m_turnGen;
}
